package org.hepeng.chaincode.contract.api;


import org.hepeng.fabric.contract.api.annotation.ContractAPI;
import org.hepeng.fabric.contract.api.annotation.TxFunction;
import org.hyperledger.fabric.contract.Context;

/**
 * @author he peng
 * @date 2022/3/25
 */

@ContractAPI(chainCode = "chaincode-java" , name = "UserContract")
public interface UserContract {

    @TxFunction(type = TxFunction.Type.SUBMIT, argType = TxFunction.ArgType.JSON , events = {"regUserEvent"})
    Result<UserInfo> regUser(Context ctx , UserInfo userInfo);

    @TxFunction(type = TxFunction.Type.QUERY , argType = TxFunction.ArgType.PRIMITIVE)
    Result<UserInfo> getUser(Context ctx , String key);

}
